<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>

       <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       <title>Insert title here</title>

              <script type="text/javascript" src="/js/jquery.min.js"></script>

              <style>
                     div{
                            padding:10px 10px 10px 10px;
                     }
              </style>
       </head>
       <body>

       <script>
              function update(id) {
                     window.open ('/temp.jsp?id='+id,'操作','height=400,width=800,top=100,left=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')
              }
              function black(){
                     window.open ('/temp.jsp','操作','height=400,width=800,top=100,left=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no')
              }

              function del(id) {
                  if (confirm("是否删除")) {
                     // 发送ajax请求
                     $.ajax({
                            url: '/resume/delete/'+id,
                            type: 'GET',
                            dataType: 'json',
                            success: function (data) {
                                   if (data.code == 200){
                                          alert("删除成功");
                                          window.location.reload();
                                   }else {
                                          alert("删除失败");
                                         }
                            }
                     })}
              }

       </script>

       <div>
       <input type="button" value="新增" onclick="black()" style="border-width: 5px" >
       </div>

       <table border="1">
              <tr>
                     <th>id</th>
                     <th>name</th>
                     <th>address</th>
                     <th>phone</th>
                     <th>操作</th>
              </tr>
              <c:forEach items="${data}" var="b" varStatus="status">
              <tr>
                     <td>${b.id}</td>
                     <td>${b.name}</td>
                     <td>${b.address}</td>
                     <td>${b.phone}</td>
                     <td>
                            <div>
                            <input type="button" id="upBtn" value="编辑" onclick="update(${b.id})"/>
                            <input type="button" id="delBtn" value="删除" onclick="del(${b.id})"/>
                           </div>
                     </td>
              </tr>
              </c:forEach>
       </table>


       </body>
       </html>